﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<!--这meta的作用就是删除默认的苹果工具栏和菜单栏。-->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<!--在web app应用下状态条（屏幕顶部条）的颜色-->
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<!--该标签用于指定是否将网页内容中的手机号码显示为拨号的超链接。-->
<meta name="format-detection" content="telephone=no"/>
<!--网页在任何时候都不能被Cache存储-->
<meta http-equiv="Expires" content="-1"/>
<!--清除缓存-->
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Pragma" content="no-cache"/>
<!--幻灯片用JS-->
<script language="javascript" type="text/javascript" src="${ctx}/static/web/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="${ctx}/static/web/js/dropload.min.js"></script>
<!--幻灯片用JS End-->
<link href="${ctx}/static/web/css/main.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/static/web/css/list.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/static/web/css/dropload.css" rel="stylesheet" type="text/css" />
<title></title>
<script language="javascript" type="text/jscript">
$(document).ready(function(){
	//点击分类图标，展示更多菜单
	$("#a-dr-menu").click(function(){
		$(".f-dr-menu").slideToggle();
	});
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isAndroid){
$('#op2').css("display" , "block");
}else{
$('#op1').css("display" , "block");
}
});	
</script>
</head>

<body style="background-color:#f5f5f5; padding-bottom:55px;">
<div class="viewport">
<div class="top-op clearfix">
<table cellspacing="0" width="100%">
<tr>
<td>
<td id="op1" style="display:none">
<div class="op">
<a href="javascript:history.go(-1);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
</div>
</td>
<td id="op2" style="display:none">
<div class="op-l">
<a href="javascript:history.go(-1);">返回</a>
</div>
</td>

<td>我的主题</td>
<td>
<div class="op-r"  style="background:none">
<a href="javascript:"></a>
</div>
</td>
</tr>
</table>
</div>
<!--问答列表-->
<div class="list-containner">
</div>
<!--问答列表 End-->
<div class="clear"></div>
<!--底部-->
<div class="footbar">
<table class="foot-tb" cellspacing="0">
<tr>
<td class="opr"><a href="javascript:" id="a-dr-menu"></a><ul class="f-dr-menu" style="display:none;"><li><a href="${ctx}/wechatapi/portal">首页</a></li><li><a href="${ctx}/wechatapi/user">我的</a></li></ul></td>
<td class="add"><a href="${ctx}/wechatapi/ask"></a></td>
<td class="search"><a href="${ctx}/wechatapi/search"></a></td>
</tr>
</table>
</div>
<!--底部 End-->
</div>
<script language="javascript" type="text/jscript">
$(function(){
	var sum = 0;
    var counter = 0;
    // 每页展示4个
    var num = 4;
    var pageStart = 0,pageEnd = 4;

    // dropload
    $('.viewport').dropload({
        scrollArea : window,
        domDown : {
            domClass   : 'dropload-down',
            domRefresh : '<div class="dropload-refresh">↓下拉加载更多</div>',
            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
            domNoData  : '<div class="dropload-noData">暂无数据</div>'
        },        
        loadDownFn : function(me){
            $.ajax({
                type: 'GET',
                url: '${ctx}/wechatapi/ajaxmyask?pageCurrent='+(counter+1),
                dataType: 'json',
                success: function(data){
                        var result = '';
                        counter++;
                        for(var i = pageStart; i < pageEnd; i++){
                        	if (i <= data.pageData.length-1){
                        		sum++;
                        		var iurl = "";
                        		if (data.pageData[i].img == null){
                        			iurl="${ctx}/static/web/img/wechat.png";
                        		}else{
                        			iurl=data.pageData[i].img+'46';
                        		}
                                result +=   '<div class="que-list" onclick="window.location=\'${ctx}/wechatapi/detail?id='+data.pageData[i].id+'\'">'
                                    +'<div class="que-t"><span>'+data.pageData[i].title+'</span><a class="btn-r right" href="${ctx}/wechatapi/detail?id='+data.pageData[i].id+'">&nbsp;</a></div>'
                                    +'<div class="clear"></div>'
                                    +'<div class="que-con clearfix">'
                                    +'<div class="photo-small">'
                                    +'<img src="'+iurl+'" /></div>'
                                    +'<div class="bref">'+(data.pageData[i].content==null?"":data.pageData[i].content)+'</div>'
                                    +'<div class="icon-area">'
                                    +'<ul><li>'+data.pageData[i].collections+'</li><li>'+data.pageData[i].replys+'</li><li>'+data.pageData[i].praise+'</li></ul></div></div></div>';                        		
                        	}
                            if(sum == data.totalRow){
                            	counter = counter-1;
                                // 锁定
                                me.lock();
                                // 无数据
                                me.noData();
                                break;
                            }
                        }
                        // 为了测试，延迟1秒加载
                        setTimeout(function(){
                            $('.list-containner').append(result);
                            // 每次数据加载完，必须重置
                            me.resetload();
                        },100);                		
                },
                error: function(xhr, type){
                    alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        }
    });		
});
</script>
</body>
</html>
